﻿using System;

namespace Shot.Routing
{
    /// <summary>
    /// Interface for a Router, which takes incoming strings and routes them to actions for an App
    /// </summary>
    public interface IRouter
    {
        /// <summary>
        /// App Instance
        /// </summary>
        App App { get; set; }

        /// <summary>
        /// Handle a route string
        /// </summary>
        /// <param name="route"></param>
        /// <param name="instance"></param>
        void Route(string route, AppInstance instance);

        /// <summary>
        /// Return true or false depending on if the route exists
        /// </summary>
        /// <param name="route"></param>
        /// <returns></returns>
        bool IsRouted(string route);

        /// <summary>
        /// Add a route to the registry.
        /// </summary>
        /// <param name="routeName"></param>
        /// <param name="routeAction"></param>
        void Add(string routeName, Action<AppInstance> routeAction);

        /// <summary>
        /// Remove a route from the registry
        /// </summary>
        /// <param name="routeName"></param>
        void Remove(string routeName);
    }
}
